<%@ page import="cn.com.entity.Vipapplication" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Date" %>
<%@ page import="cn.com.controler.Util.TimeTr" %>
<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2020/10/25
  Time: 15:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" errorPage="/WebContent/Public/error/nomyvip.jsp" %>
<html>
<head>
    <title>我的Vip会员</title>
    <style>
        .allcont{
            margin-top: 50px;
            width: 800px;
            border: 2px solid #4aa3d6;
            margin: 0 auto;
        }
        .allcont .title{
            width: 100%;
            height: 30px;
            line-height: 30px;
            text-align: center;
            font-size: 18px;
            padding: 10px 0;
        }
        .allcont .vipstate{
            width: 100%;
            height: 30px;
            line-height: 30px;
            padding: 10px;
        }
        .allcont>div{
            width: 100%;
            height: 30px;
            line-height: 30px;
            padding: 10px;
        }
        .allcont>div.djs{
            position: relative;
        }
        .djs-day{
            font-size: 18px;
            font-weight: 700;
            position: absolute;
            right: 150px;
        }
    </style>
</head>
<body>
<%
    Object myapp = request.getAttribute("myappp");
    if(myapp != null){
        List list = (List)myapp;
        long x;
        Vipapplication vipapp = (Vipapplication) list.get(0);
        //获得申请结束时间
        String datev = vipapp.getVipUserAppEndTime();
        //把事件转为DAte类型
        Date enddate = TimeTr.String_Date1(datev);
        //获取当前时间
        Date today = new Date();
        //获得结束时间的毫秒数
        long time = enddate.getTime();
        //获得当前时间的毫秒数
        long time1 = today.getTime();
        //获得剩余天数的毫秒数
        long l = time - time1;
        if(l > 0){
            x = l;
        }else{
            x = 0;
        }
        //获得天数
        long day = x/1000/60/60/24;
%>
<article class="allcont">
    <div class="title">会员名称：<span style="color: red">SVIP</span></div>
    <div class="vipstate">会员说明：
        <span style="color:blue">
                   会员享有数十种不同的特殊字体，当你和别人聊天或者评论时更炫酷!
              </span>
    </div>
    <div class="why">申请原因：<span style="color: blue"><%=vipapp.getVipUserAppWhy()%></span></div>
    <div class="starttime">申请开始时间：<span style="color:blue;font-weight: 600"><%=vipapp.getVipUserAppStartTime()%></span></div>
    <div class="endtime">申请结束时间：<span style="color: blue;font-weight: 600"><%=vipapp.getVipUserAppEndTime()%></span></div>
    <div class="djs">
        <div class="djs-day">
            剩余<span style="color: red"><%=day%></span>天
        </div>
    </div>
</article>
<%
    }else{
        %>
<article class="allcont">
    <div class="title">您还没有会员，请您尽快申请!</div>
</article>
<%
    }
%>


</body>
</html>
